package com.sitech.portal.bigScreen.action;

import com.sitech.ibnms.core.JGridBaseAction;
import com.sitech.portal.bigScreen.form.TbScreenPhysicalForm;
import com.sitech.portal.bigScreen.service.IScreenPhysicalService;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2015/4/22.
 */
public class ScreenPhysicalAction extends JGridBaseAction {
    private IScreenPhysicalService screenPhysicalService;
    private TbScreenPhysicalForm form = new TbScreenPhysicalForm();
    private List<String> ids = new ArrayList<String>();
    private boolean ifExist = false;

    public String queryList() {
        setResult(screenPhysicalService.queryScreenPhysicalByFilter(form.getPhysicalScreenName(), this.getPageForm()));
        return SUCCESS;
    }

    public String addScreenPhysical() {
        screenPhysicalService.addOrUpdateScreenPhysical(form, ids);
        return SUCCESS;
    }

    public String delete() {
        screenPhysicalService.deleteScreenPhysicalById(form.getPhysicalScreenId());
        return SUCCESS;
    }

    public String ifNameExist() {
        ifExist = screenPhysicalService.ifNameExist(form);
        return SUCCESS;
    }

    /**
     * get和set方法
     */
    public void setScreenPhysicalService(IScreenPhysicalService screenPhysicalService) {
        this.screenPhysicalService = screenPhysicalService;
    }

    public TbScreenPhysicalForm getForm() {
        return form;
    }

    public void setForm(TbScreenPhysicalForm form) {
        this.form = form;
    }

    public List<String> getIds() {
        return ids;
    }

    public void setIds(List<String> ids) {
        this.ids = ids;
    }

    public boolean isIfExist() {
        return ifExist;
    }
}
